<!--
  - createaccount.html
  - v0.01
  - 1/28/2011
  - 
  - This source code is the user interface for the create account function.
  -->
<?php
	session_start();
	require 'libraries/UserLibrary.php';
	
	isSessionSet("administrator", null, "index.php");
?>
<html>
	<head>
		<title>CASLIMS | Create Account</title>
		<link rel="stylesheet" type="text/css" href="scripts/page.css" />
		<script type="text/javascript" src="scripts/validateCreateAccount.js"></script>
		<link href="tools/favicon.ico" rel="shortcut icon" type="image/x-icon" /> 
	</head>
	<body>
		<div id="header"></div>
		<div id="wrapper">
			<div id="pagetop">
				<div class="greeting">Hi, <?php echo $_SESSION["administrator"];?> | <a href="Logout.php">Log out</a> | <a href="AdministratorHomepage.php"> Home </a></div>
				<div class="homepage"><?php echo $_SESSION["administrator"];?></div>
			</div>
			<form name="createaccount" action="ProcessCreateAccount.php" method="post" onsubmit= "return validateCreateAccount();">
					<div id="fieldname">
						<h2>Create New Account</h2>
						All fields are required. You will be logged out once an account is created.
						<?php
						if(isset($_GET['error'])){
							echo "</br><p class='fail'>Account creation failed.";
							unset($_GET['error']);	
						}
						?>								
					</div>
					<br/>
					<table>
						<tr>
							<td>Username:</td>
							<td><input type="text" name="username" id="username" size="30"></td>
							<td><div id="usernameerror" class="error"></div></td>
						</tr>
						<tr>
							<td>Password:</td>
							<td><input type="password" name="password1" id="password1" size="30"></td>
							<td><div id="password1error" class="error"></div></td>
						</tr>
						<tr>
							<td>Retype:</td>
							<td><input type="password"  id="password2" size="30"></td>
							<td><div id="password2error" class="error"></div></td>
						</tr>		
						<tr>
							<td>Name:</td>
							<td><input type="text" name="name" id="name" size="30"></td>
							<td><div id="nameerror" class="error"></div></td>
						</tr>
						<tr>
							<td>Title:</td>
							<td><input type="text" name="title" id="title" size="30"></td>
							<td><div id="titleerror" class="error"></div></td>
						</tr>
						<tr>
							<td>Position:</td>
							<td><input type="text" name="position" id="position" size="30"></td>
							<td><div id="positionerror" class="error"></div></td>
						</tr>
						<tr>
							<td>Usertype:</td>
							<td><input type="radio" name="usertype" checked value="ANALYST"/>Analyst</td>
							<td></td>
						</tr>
					</table>
					<div id="buttons">
						<input type="submit" value="Create Account"/>
						<input type="button" value="Home" 
								onClick='document.location.href = "AdministratorHomepage.php"'>
					</div>
			</form>
			<div id="footerwrap">
				<div id="footer"> 
					<div class="copyright">Copyright 2011.<a>CASL BIOTECH-UPLB.</a> All Rights Reserved.<br/> 
				Arianne Buse&ntilde;os | Darlene Joy Masong | Rick Jason Obrero | Jonathan Pandi | Jonathan Simbahan | Emmanuel Soriano 
					</div> 
	    	    </div>
			</div>				
		</div>
	</body>
</html>